/*
 * @Description: 路由文件配置
 * @Author: seadon
 * @LastEditors: seadon
 * @Date: 2021-07-07 10:46:58
 * @LastEditTime: 2022-09-15 17:46:42
 */
import { createRouter, createWebHashHistory } from 'vue-router'
import routes from './routers'
import { client, path } from '@/utils'

const router = createRouter({
	history: createWebHashHistory(process.env.VUE_APP_BASE_PATH + 'mobile'),
	routes,
})

router.beforeEach((to, from, next) => {
	if (client.isPc()) {
		window.location.href = 'desktop.html'
	}
	console.log(to.meta.title, 'to.meta')
	document.title = to.meta.title as string
	next()
})

export { routes }
export default router
